package com.kakarote.core.common;

import java.util.Optional;

/**
 * @author zjj
 * @description: TenantSkipHolder
 * @date 2022/6/13
 */
public class TenantSkipHolder {

    private static final ThreadLocal<Boolean> SKIP_TABLE_THREAD_LOCAL = new ThreadLocal<>();

    public static Boolean isSkip() {
        return Optional.ofNullable(SKIP_TABLE_THREAD_LOCAL.get()).orElse(false);
    }

    public static void setSkip(Boolean isSkip) {
        SKIP_TABLE_THREAD_LOCAL.set(isSkip);
    }

    public static void remove() {
        SKIP_TABLE_THREAD_LOCAL.remove();
    }
}
